package com.jesper.seckill.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate.ConfirmCallback;


/**
 * rabbit消费者回调通知
 */
public class MsgSendConfirmCallBack implements ConfirmCallback{
	
	private Logger logger = LoggerFactory.getLogger(MsgSendConfirmCallBack.class);
	
	@Override
    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
        logger.info("MsgSendConfirmCallBack="+correlationData);
        if(ack){
            logger.info("消息消费成功!");
        }else{
            logger.info("消息消费失败:"+cause+"\n重新发送");
        }
    }

}
